/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wbd_au.objects_mappings;

import java.sql.SQLData;
import java.sql.SQLException;
import java.sql.SQLInput;
import java.sql.SQLOutput;

/**
 *
 * @author Gospo
 */
public class Region implements SQLData{
    int idRegion;
    String kryptonim;
    int obszarWMetrach;
    int iloscBudynkow;
    int priorytetBezpieczenstwa;
    int wymaganaIloscWartownikow; 
  
    String sqlType;

    @Override
    public String getSQLTypeName() {
        return sqlType;
    }

    @Override
    public void readSQL(SQLInput stream, String typeName) throws SQLException {
        sqlType = typeName;

        idRegion = stream.readInt();
        kryptonim = stream.readString();
        obszarWMetrach = stream.readInt();
        iloscBudynkow = stream.readInt();
        priorytetBezpieczenstwa = stream.readInt();
        wymaganaIloscWartownikow = stream.readInt();
    }

    @Override
    public void writeSQL(SQLOutput stream) throws SQLException {
       stream.writeInt(idRegion);
       stream.writeString(kryptonim);
       stream.writeInt(obszarWMetrach);
       stream.writeInt(iloscBudynkow);
       stream.writeInt(priorytetBezpieczenstwa);
       stream.writeInt(wymaganaIloscWartownikow);
   }
}
